package com.alex.homework.bean;

import java.util.Date;

public class User {
	private Date time;
	private Integer age;
	private String name;
	private String pass;

	public User () {
		super ();
	}

	public User (Integer age, String name, String pass, Date time) {
		super ();
		this.age = age;
		this.name = name;
		this.pass = pass;
		this.time = time;
	}

	@Override
	public String toString () {
		return "User [age=" + age + ", name=" + name + ", pass=" + pass + ", time=" + time.toString () + "]";
	}

	@Override
	public int hashCode () {
		final Integer prime = 31;
		Integer result = 1;
		result = prime * result + age;
		result = prime * result + ((name == null)? 0:name.hashCode ());
		result = prime * result + ((pass == null)? 0:pass.hashCode ());
		result = prime * result + ((time == null)? 0:time.hashCode ());
		return result;
	}

	@Override
	public boolean equals (Object obj) {
		if (this == obj) return true;
		if (obj == null) return false;
		if (getClass () != obj.getClass ()) return false;
		User other = (User) obj;
		if (age != other.age) return false;
		if (name == null) {
			if (other.name != null) return false;
		} else if (!name.equals (other.name)) return false;
		if (pass == null) {
			if (other.pass != null) return false;
		} else if (!pass.equals (other.pass)) return false;
		if (time == null) {
			if (other.time != null) return false;
		} else if (!time.equals (other.time)) return false;
		return true;
	}

	public Integer getAge () {
		return age;
	}

	public void setAge (Integer age) {
		this.age = age;
	}

	public String getName () {
		return name;
	}

	public void setName (String name) {
		this.name = name;
	}

	public String getPass () {
		return pass;
	}

	public void setPass (String pass) {
		this.pass = pass;
	}

	public Date getTime () {
		return time;
	}

	public void setTime (Date time) {
		this.time = time;
	}
}
